import { NoSkinCellRenderer } from "../../../common/item/NoSkinCellRenderer";
import { Language } from "../../../../../../extend/language/Language";
import { Dispatcher } from "../../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../../events/DataEvent";
import { EventName } from "../../../../mvc/EventName";
import { ObjCreate } from "../../../common/ObjCreate";
import { ResFileConst } from "../../../../resource/ResFileConst";
import { GlobalStyle } from "../../../../../common/global/GlobalStyle";
import { GTextFiled } from "../../../../../../com/mui/controls/GTextFiled";
import { GLoadedButton } from "../../../../../../com/mui/controls/GLoadedButton";
//class CrossSeaEnterRender
    
    export  class CrossSeaEnterRender extends NoSkinCellRenderer
    {
        constructor()
        {
            super();
            this.initView();
            this._btnEnter.addEventListener(flash.events.MouseEvent.CLICK, this.clickEnterHandler);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            if (arg1 == null || typeof arg1 == "undefined") 
            {
                return;
            }
            _data = arg1;
            this._txtPlayerNum.text = Language.getStringByParam(80145, _data.playerNum.toString()) + "/150";
            return;
        }

        /* internal  */clickEnterHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (_data == null) 
            {
                return;
            }
            Dispatcher.dispatchEvent(new DataEvent(EventName.CrossSeaEnterSeaReq, _data));
            return;
        }

        /* internal  */initView(): void
        {
            this._btnEnter = ObjCreate.createGLoadedButton(ResFileConst.SkyCityBtn, 5, 5, 105, 106, this);
            this._txtPlayerNum = ObjCreate.createGTextField("", 26, 60, 150, 20, this, GlobalStyle.textFormat6);
            this._txtPlayerNum.mouseEnabled = false;
            return;
        }

        /* internal */ /* var */_txtPlayerNum: GTextFiled;

        /* internal */ /* var */_btnEnter: GLoadedButton;
    }
